home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / TSPA3460 / TSPAS.NWS < prev    next >
Text File  |  1994-08-16  |  35KB  |  678 lines

  1. News on the TSPAS package by Timo Salmi in reverse order
  2. ========================================================
  3.  
  4. University of Vaasa, Finland, Sun SPARCstation IPX garbo.uwasa.fi
  5. has a large collection of PD and shareware PC programs available by
  6. anonymous ftp and mail server. The file /pc/ts/0news-ts contains
  7. news about the TS-programs in the /pc/ts directory (in reverse
  8. order). This text, which you now have, is an extract from the
  9. 0news-ts file and the UseNet news.
  10. ..................................................................
  11. Prof. Timo Salmi      Co-moderator of comp.archives.msdos.announce
  12. Moderating at garbo.uwasa.fi anonymous FTP  archives  128.214.87.1
  13. Faculty of Accounting & Industrial Management; University of Vaasa
  14. Internet: ts@uwasa.fi   BBS +(358)-61-3170972; FIN-65101,  Finland
  15. ..................................................................
  16.  
  17. ┌────────────────────────────────────────────────────────────────┐
  18. │ Appeal: Let me take up a request for those of you who may have │
  19. │ found my programs or units useful.  As I am not asking for a   │
  20. │ registration fee for private versions, would you do me a       │
  21. │ reciprocal favor by uploading at least some of my packages to, │
  22. │ say eg one local bulletin board (BBS), and thus contribute to  │
  23. │ disseminating the *latest* versions of these packages.  And,   │
  24. │ if you distribute these packages, would you PLEASE distribute  │
  25. │ an entire package, not individual programs from within any     │
  26. │ package. This is a request that all of us share who write      │
  27. │ freeware, PD and shareware programs.                           │
  28. └────────────────────────────────────────────────────────────────┘
  29.  
  30. Tue 16-Aug-94: Updated my Turbo pascal units collection to be
  31. garbo.uwasa.fi:/pc/ts/tspa34*.zip (*=40,50,55,60,70). Added to
  32. TSUTNJ:
  33.   "OPENFLFN Is an assigned non-textfile still open or not"
  34. TSERR (run-time error verbal listing):
  35.   Brought the error messages up to date with the TP 7.0 set.
  36.   Introduced a new unit for keyboard routines TSUNTM. In TSUNTG if
  37. one of the routines below were called while that key is depressed
  38. the program was suspended until the key is released. My thanks are
  39. due to Angus March (ac_march@ECE.concordia.CA) who alterted me to
  40. this problem. All these routines, together with the author keyboard
  41. routines from TSUNTG have been corrected and transferred to a new
  42. TSUNTM unit.
  43.     ALTFN    Is the alt key depressed
  44.     CTRLFN   Is the ctrl key depressed
  45.     LFALTFN  Is the left alt key depressed
  46.     LFCTRLFN Is the left ctrl key depressed
  47.     LFSHFTFN Is the left shift key depressed
  48.     RTALTFN  Is the right alt key depressed
  49.     RTCTRLFN Is the right ctrl key depressed
  50.     RTSHFTFN Is the right shift key depressed
  51.     SYSRQFN  Is the SysRq key depressed
  52.   Added the following two detection routines to TSUNTG
  53.     CDROMFN  Is a drive a CD-ROM with MSCDEX driver installed
  54.     MSCVERFN Get CD-ROM driver MSCDEX.EXE version
  55.  
  56. Mon 16-Aug-93: Based on some welcome feedback and on my own
  57. observations I have released an update of my Turbo Pascal units
  58. collection. It is now garbo.uwasa.fi:/pc/ts/tspa33*.zip where * =
  59. 40,50,55,60,70.
  60. Added to unit TSUNTC the reversal of enabling hi-intensity
  61. background
  62.   BLBACK "Cancel HIBACK enabling usage of blinking text"
  63. Added to TSUNTG
  64.   ISRAMFN "Is a drive a probable ramdisk"
  65. Corrected a bug giving occasional random results in TSUNTH
  66.   LASTDRFN "Get last drive of the system, softcoded, not XTs"
  67. If you have used LASTDRFN, you should compile your program anew.
  68. Added to TSUNTJ
  69.   ISDIR3FN "Is a name a directory or not", a slower and surer method
  70. see garbo.uwasa.fi:/pc/ts/tsfaqp*.zip for details of ISDIR3FN.
  71. Reprogrammed in TSUNTENV unit
  72.   SETENV "Set a parent environment variable (variable=value)"
  73. It now accepts equal signs in the 'value'. I also added an example
  74. to TSUNTENV.TST to show how to set several environment variable
  75. values.
  76. Moved to a new TSUNTBOT unit from TSUNTG
  77.   COLDBOOT "Reboot computer, including memory tests"
  78.   WARMBOOT "Warm reboot of the computer (as alt-ctrl-del)"
  79. and added to this new unit
  80.   REBOOT   "Reboot computer with disk closing and cache flushing"
  81.  
  82. Wed 24-Feb-93: I have updated my Turbo Pascal units collection. It
  83. is now garbo.uwasa.fi:/pc/ts/tspa32*.zip where * = 40,50,55,60,70.
  84.    I replaced CHIPFN "Get the type of the processor chip" with
  85. CPUFN. It should detect also a 486 while CHIPFN did not. My thanks
  86. to Duncan Murdoch for his help in this.
  87.    The new routines added are
  88.   ISEGAFN  Is at least an EGA present. No graph unit needed
  89.   NOLABEL  Delete a disk's volume label.
  90.   SCROLLDN Scroll down a window. No Crt unit needed
  91.   SCROLLUP Scroll up a window. No Crt unit needed
  92.   SETLABEL Set a disk's volume label.
  93.  
  94. Sat 23-Jan-93: As all Turbo Pascal users know to our common chagrin
  95. the different Turbo Pascal version TPUs are not compatible across
  96. the versions. I have made a Turbo Pascal 7.0 real mode compatible
  97. rendition of my Turbo Pascal units garbo.uwasa.fi:/pc/ts/
  98. tspa3170.zip.
  99.    Since some users may ask, I am not going to make protected mode
  100. nor TPW compatible versions. Protected mode programming has quirks
  101. of it own, and is thus specialized. As for TPW, I do not use Windows
  102. myself, and have thus no real interest of supporting it.
  103.   The other, non-updated versions are
  104.     garbo.uwasa.fi:/pc/ts/tspa3140.zip
  105.     garbo.uwasa.fi:/pc/ts/tspa3150.zip
  106.     garbo.uwasa.fi:/pc/ts/tspa3155.zip
  107.     garbo.uwasa.fi:/pc/ts/tspa3160.zip
  108.  
  109. Sun 8-Nov-92: I have again updated my Turbo Pascal units collection.
  110. It is now garbo.uwasa.fi:/pc/ts/tspa31*.zip where * = 40,50,55,60.
  111. The new routines added are
  112.  TSUNTB:
  113.    BBINFN   Convert decimal byte to binary string
  114.    BHEXFN   Convert decimal byte to hexadecimal string
  115.  TSUNTE:
  116.    ARCFILFN Is a file's archive bit set or not
  117.    HIDFILFN Is a file a hidden file or not
  118.    RDOFILFN Is a file a read-only file or not
  119.    SYSFILFN Is a file a system file or not
  120.  TSUNTG:
  121.    ACTDRVFN Which floppy drive is active on a one drive system
  122.    FLOPSTFN Floppy disk status. Is it present and formatted.
  123.    ISUBSTFN Is a drive a substituted drive (MsDos 3.1+)
  124.    MEDIAFN  What kind of a disk media is present in a drive
  125.               returns: $00 : Error
  126.                        $F0 : Floppy of 1.44Mb
  127.                        $F8 : Fixed disk
  128.                        $F9 : Floppy of 1.2Mb
  129.                        $FA : Floppy of 720Kb
  130.                        $FD : Floppy of 360Kb
  131.                        $FF : Floppy of 320Kb
  132.  TSUNTJ
  133.    ISDIR2FN Is a name a directory or not, alternative method
  134.  
  135. Sun 20-Sep-92: In my Turbo Pascal units there is a number of
  136. editable readln substitutes:
  137.  TSUNTF: (uses Dos, Crt)
  138.   EDRDLN   Readln with line-editing potential (the simplest)
  139.   EDREABLN Edreadln with ctrl-c and break trapping
  140.   EDREADLN Editable Readln with recall, and insert toggle
  141. I have written alternative versions of these routines which can take
  142. a PrefillString as the default input string, so the user has an
  143. option of just pressing enter, and default is selected.
  144.   EDRDEBLN Editable Readln with ctrl-c, break trapping, pre-fill etc
  145.   EDRDEFLN Editable Readln with recall, pre-fill, and insert toggle
  146. The suggestion to make this enhancement came from Darrell Davis
  147. davisd@ziavms.enmu.edu. My thanks to Darrell for his useful
  148. suggestion.
  149.  garbo.uwasa.fi:/pc/ts/tspa3040.zip
  150.  garbo.uwasa.fi:/pc/ts/tspa3050.zip
  151.  garbo.uwasa.fi:/pc/ts/tspa3055.zip
  152.  garbo.uwasa.fi:/pc/ts/tspa3060.zip
  153.  
  154. Wed 26-Aug-92: Updated my Turbo Pascal units collection. It is now
  155.  garbo.uwasa.fi:/pc/ts/tspa29*.zip
  156. where * = 40,50,55,60.
  157.    Bug fixed (hopefully) the ISDIRFN "Is a name a directory or not"
  158. function in TSUNTJ unit. My thanks are due to Richard (Ricki) Breuer
  159. ricki@rwthi3.informatik.rwth-aachen.de for alerting me to the
  160. problem.
  161.    In the process we noticed a rather undesirable feature of DRDOS.
  162. All my units are written for MsDos (command.com). The alternative
  163. command interpreters like DRDOS and 4DOS can cause incompatibilities
  164. since some of Turbo Pascal's routines (like IOResult) utilize the
  165. values the system returns. There is nothing I can do about
  166. incompatibilities like this, and it is a coincidence that we even
  167. noticed, since I do not run 4DOS or DRDOS. Anyway, ISDIRFN eill not
  168. work as expected if you are using DRDOS. I do not know about 4DOS.
  169.    SETENV "Set a parent environment variable (variable=value)" in
  170. the TSUNTENV unit now accepts cases like TARGET=A B C (formerly the
  171. it was cut at the spaces).  Also this suggestion is to to Ricki. Be
  172. careful.  Trailing white spaces and other invisible characters you
  173. might put in there are included. Thus "TARGET=A" and "TARGET=A " are
  174. not the same thing.
  175.    Started a new 4.0+ specific unit TSUNTK. It contains the
  176. following routines.
  177.   BOOTDRFN Get boot device name (MsDos 4.0+)
  178.   GETSERFN Get disk's serial number (MsDos 4.0+)
  179.   GETVOLFN Special get disk volume label (MsDos 4.0+)
  180.   SETSER   Set floppy's serial number (MsDos 4.0+)
  181. The first, that is BOOTDRFN was transferred from the TSUNTH unit.
  182. The others are brand new. I got the idea to get and set the disk
  183. serial number from PC-Magazine (July 1992, Vol. 11, No. 13, p. 496)
  184. which published TP 6.0 specific code for these tasks. Since my own
  185. TP units are more general, that is for all the current MsDos TP
  186. versions starting from TP 4.0, I decided to write routines of my own
  187. for these tasks. But the users interested in a source code may wish
  188. to look at the article.  (I did not bother to test whether the
  189. PC-Magazine code works, but I don't see why not). I got interested
  190. because I now use MsDos 5.0 in addition to 3.30 and 3.21 (and the
  191. aggravating 4.01).
  192.    Added HEXLNGFN "Convert hexadecimal string to decimal longint up
  193. to 7FFFFFFF" to the conversion unit TSUNTB because TSUNTK internally
  194. needs this conversion in accessing the disk serial number.
  195.    Added to TSUNTE the following elementary routines, just because I
  196. occasionally happen to need them myself.
  197.   LABELFN  Get a disk's volume label (not for TP 4.0)
  198.   DEFDRVFN Get the default drive
  199.    Finally added HIBACK to TSUNTC to enable high intensity
  200. background colors instead of enabling blinking text. The appropriate
  201. interrupt was pointed out by Robert Beauchaine bobb@vice.ICO.TEK.COM
  202. on the UseNet news in comp.lang.pascal. The routine requires an EGA,
  203. MCGA, or a VGA.
  204.  
  205. Sat 13-Jun-92: Updated my Turbo Pascal units collection. It is now
  206.  garbo.uwasa.fi:/pc/ts/tspa28*.zip
  207. where * = 40,50,55,60.
  208. Added to TSUNTG unit
  209.   GETESCAN Get scancode of key pressed, enhanced keyboard.
  210.   GETSCAN  Get scancode of key pressed, XT keyboard.
  211. The TSUNTENV unit already had
  212.   SETENV   Set a parent environment variable (variable=value).
  213. but this takes effect only after the program has been completed.
  214. Added an alternative which takes effect immediately, but is
  215. temporary
  216.   SETENVSH Set an environment variable for the duration of shelling.
  217. One of the handy uses of SETENVSH is that you can temporarily change
  218. the prompt to indicate that you are shelled out of a program so that
  219. you are less likely to forget to type exit. See TSUNTG.TST for how
  220. to use this feature.
  221.  
  222. Sat 8-Feb-92: I have updated my Turbo Pascal units collection to be
  223.  garbo.uwasa.fi:/pc/ts/tspa2740.zip
  224.  garbo.uwasa.fi:/pc/ts/tspa2750.zip
  225.  garbo.uwasa.fi:/pc/ts/tspa2755.zip
  226.  garbo.uwasa.fi:/pc/ts/tspa2760.zip
  227. This time I have introduced (parent) environment related routines in
  228. a new TSUNTENV.TPU unit
  229.   ENVSIZFN Get the size of the parent environment
  230.   ENVUSEFN Get the current use of the parent environment
  231.   ENVADDFN Get the starting segment address of the parent environment
  232.   SETENV   Set a parent environment variable (as MsDos SET var=value)
  233.   SHOWENV  Write the parent environment table on stdout (for testing)
  234. Setting a parent environment variable from within a Turbo Pascal
  235. program can be considered reasonably advanced programming I guess,
  236. and I cannot be absolutely sure that I got it right. But here goes
  237. anyway. The key to the task is obtaining the starting address of the
  238. parent environment, and knowing that the format of the parent
  239. environment table in memory is
  240.       name=value1<nul>name=value2<nul>...name=valueN<nul><nul>.
  241. PC Magazine Vol. 11, No. 1, pp. 425-427 has useful code which can be
  242. adapted to find out the relevant segment address. Should you look at
  243. that article, the crucial variable to get at in there is EnvSeg. The
  244. rest then follows. What a delightfully complicated challenge.
  245.    Oh yes, since I know that some users will be asking for the
  246. source code. I am happy to share this reference, and make my .TPU
  247. collection publicly available, but I have chosen not to distribute
  248. by source codes.
  249.    In fact I have not added the unit to the tspas2740.zip TP 4.0
  250. version TPUs, but I have updated it nevertheless to avoid confusion
  251. with the version numbers.
  252.  
  253. Mon 6-Jan-92: I have updated my Turbo Pascal units collection to be
  254.  garbo.uwasa.fi:/pc/ts/tspa2640.zip
  255.  garbo.uwasa.fi:/pc/ts/tspa2650.zip
  256.  garbo.uwasa.fi:/pc/ts/tspa2655.zip
  257.  garbo.uwasa.fi:/pc/ts/tspa2660.zip
  258. by transferring the following routines from TSUNTH.TPU unit to a new
  259. TSUNTJ.TPU unit
  260.   COPYFILE Copy a file from within a Turbo Pascal program
  261.   OPENEDFN Is an assigned textfile still open or not
  262.   ISDIRFN  Is a name a directory or not
  263.   PIPEDIFN Is the standard input from redirection
  264.   PIPEDNFN Is the standard output redirected to nul
  265.   PIPEDOFN Is the standard output redirected
  266. by adding the following routines to TSUNTJ.TPU
  267.   INTRADDR Show the memory address to which the interrupt points
  268.   INTRLOCA Show the memory address where the interrupt is located
  269. and by adding the following routines to TSUNTH.TPU
  270.   ISMOUSFN A simple true/true false test of mouse available
  271.   MOUSTAFN Status (type byte) of the mouse hardware and driver
  272. My thanks are due to Duncan Murdoch in particular who first noted a
  273. potential error in the early version of my mouse functions.
  274.    The first of the sets garbo.uwasa.fi:/pc/ts/tspa2640.zip contains
  275. a compatibility unit TSUNT45.TPU for Turbo Pascal 4.0. It adds
  276. routines that the later versions have, but which are missing in
  277. version 4.0. I have added
  278.   GetVerify Get the status of the MsDos write verify flag
  279.   SetVerify Set the status of the MsDos write verify flag
  280.   GetCBreak Get the state of Ctr-Break checking in DOS
  281.   SetCBreak Set the state of Ctr-Break checking in DOS
  282.  
  283. Sun 27-Oct-91: I have updated my Turbo Pascal units collection to be
  284.  garbo.uwasa.fi:/pc/ts/tspa2540.arc
  285.  garbo.uwasa.fi:/pc/ts/tspa2550.arc
  286.  garbo.uwasa.fi:/pc/ts/tspa2555.arc
  287.  garbo.uwasa.fi:/pc/ts/tspa2560.arc
  288. by adding the following routines
  289.   ISANSIFN Has ansi.sys a a similar driver been loaded
  290.   BTEWRDFN Combine two bytes into a single word, inverse of Hi & Lo
  291.   WRDLNGFN Combine two words into a longint
  292.   HIWORDFN The high-order (hi) word of the longint argument
  293.   LOWORDFN The low-order (lo) word of the longint argument
  294.  
  295. Sun 21-Jul-91: I have updated my Turbo Pascal units collection to be
  296. /pc/ts/tspa24##.arc (where ## = 40, 50, 55, and 60).
  297.    Turbo Pascal 5.0 (and later) introduced some routines which are
  298. not present in version 4.0. My Turbo Pascal units collection (the
  299. 4.0 version) includes a TSTPU45 unit which introduces some of the
  300. missing routines also to TP 4.0. I have added FExpand (Expand a file
  301. name into a fully qualified file name) to this unit.
  302.    Occasionally you will want to be able to tell where the standard
  303. input to your program comes from.  Does it come in the normal way
  304. from the keyboard, or does it come from redirection. Likewise, you
  305. may wish your program to know whether its standard output goes to
  306. the screen, or is it redirected to a file or through a pipe. The
  307. new boolean functions in the TSUNTH.TPU unit will give this
  308. information:
  309.   PIPEDIFN Is the standard input from redirection
  310.   PIPEDOFN Is the standard output redirected
  311.   PIPEDNFN Is the standard output redirected to nul
  312. Other new routines in the TSUNTH unit include:
  313.   BOOTDRFN Get boot device name (MsDos 4.0+)
  314.   DATEFMFN Country-dependent date format (MsDos 3.0+)
  315.   NRCYLFN  Number of cylinders on a drive if media present (MsDos 3.2+)
  316.   TIMEFMFN Country-dependent time format (MsDos 3.0+)
  317.   Z2ASZFN  Convert an Asciiz string into an ordinary ascii string
  318.  
  319. Tue 8-Jan-91: My Turbo Pascal units collection is now available also
  320. for Turbo Pascal 6.0. It is /pc/ts/tspa2360.arc, and is in no other
  321. way different from tspa2340.arc, tspa2350.arc, and tspa2355.arc
  322. except that the units are for 6.0. As you know, Turbo Pascal units
  323. are not compatible across versions.
  324.  
  325. Sat 5-Jan-91: I have upgraded my Turbo Pascal units collection at
  326. uwasa.fi archives by making several changes. Most importantly I have
  327. divided the package into three parallel packages:
  328.   tspa2340.arc  for Turbo Pascal 4.0 version
  329.   tspa2350.arc  for Turbo Pascal 5.0 version
  330.   tspa2355.arc  for Turbo Pascal 5.5 version
  331. Thus you'll only need the package concurring with the Turbo Pascal
  332. version you use yourself. With the exception of the differences
  333. inherent to the different releases of Turbo Pascal, the packages are
  334. the same.
  335.    I am expecting Turbo Pascal 6.0, but it has not arrived yet.
  336.    I have added a new unit TSERR.TPU which turn on the verbal
  337. run-time error messages. It is very easy to use. Just include
  338.  uses TSERR;
  339. at the beginning of your main program and you'll have verbal
  340. run-time error messages besides the original, cryptic error codes.
  341.    I have done some cleaning of the old units by omitting some of
  342. the older routines which have a more efficient later replacement. In
  343. particular this concerns the functions for converting values from
  344. one base to another.
  345.    There are also new routines:
  346.   PARSENFN Number of substrings in a string (resembles ParamCount)
  347.   PARSERFN Get substrings from a string (resembles ParamStr)
  348.   FATSFN   Get number of file allocation tables, not XTs
  349.   INTERLFN Get interleave coefficient of a harddisk, not XTs
  350.   LASTDRFN Get last drive of the system, softcoded, not XTs
  351. and the generic power function POWERGFN has been rewritten.
  352.  
  353. Wed 8-Aug-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  354. collection to be version (/pc/ts/)tspas22.arc.
  355.    There are several functions which Tubro Pascal 5.0 and 5.5 have,
  356. but TP 4.0 does not.  I have added a new unit tsunt45.tpu which
  357. includes some of these functions such as EnvCount, EnvStr, GetEnv,
  358. and ParamStr0 (giving the name of the program).
  359.    The unit tsunti.tpu can be used to put information into the .exe
  360. file and perform selftests of the .exe.  This unit is now also
  361. available for TP 4.0.
  362.    Turbo Pascal ReadKey lacks the ability to read special keys such
  363. as RightShift, LeftShift, RightCtrl, and so on.  Functions to detect
  364. pressing these keys have been added.
  365.    Turbo Pascal ReadKey also lacks the ability to cope with the full
  366. enhanced keyboard potential. This means that TP ReadKey does not
  367. detect pressing F11 or F12, and that it cannot distinguish between
  368. the numeric keyboard cursor keys and the grey cursor keys. I have
  369. added a RDENKEFN function which has these abilities.
  370.  
  371. Wed 1-Aug-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  372. collection to be version (/pc/ts/)tspas21.arc.
  373.    Turbo Pascal version 4.0 does not have the DosVersion function
  374. available in versions 5.0 and 5.5. I have written this function for
  375. version 4.0. Furthermore the lack of this function caused errors in
  376. TP 4.0 versions of my last two units.  This has been put right.
  377.    I have included a new unit (tsunti.tpu) for putting information
  378. into the .exe file, and retrieving the information (not for TP 4.0).
  379. The routines include a method for calculating the direct checksum
  380. for a file (eg for virus checking). This is not as trivial as it may
  381. sound at first sight, because in calculating the checksum, the
  382. checksum constant within the program must be skipped. (Else a change
  383. in the checksum constant would alter the checksum resulting in a
  384. "vicious circle"). Also, the method must be fast enough.
  385.    I have also included a fast a date and filesize checking method
  386. for detecting if the .exe has been pacthed or its size altered. (Of
  387. course, the checksum method is much more difficult to defeat, but it
  388. is more complicated and not as fast). Here I have made an exception
  389. and included the source code. It is in the selftest.pas file within
  390. tspas21.arc.
  391.  
  392. Mon 23-Jul-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  393. collection to be version (/pc/ts/)tspas20.arc.
  394.    One problem area that has intrigued me for some time is finding a
  395. technique for storing information within an executable file and
  396. updating that information. I've looked into it and written a couple
  397. of relevant procedures. USECOUNT keeps track of how many times the
  398. program has been run and stores the result within the .exe file.
  399. BRANDEXE is a more general, but also a more complicated procedure
  400. for .exe file handling. As an example I have a demonstration how to
  401. tell the previous time when the program was run.
  402.    The function checking the on-line status of the printer
  403. (prnonlfn) has been rewritten to work without Turbo Pascal's Crt
  404. unit. And an alternative printer on-line status function, LTPONLFN,
  405. has been added. This one should be more robust, because it actually
  406. tries to send a carriage return to the printer, and observes the
  407. resultant success of the operation to define the on-line status. Of
  408. course this is achieved by {$I-} {$I+} IOResult testing, but the
  409. real trick here is make to system respond immediately rather than in
  410. the default response time of up to one minute. A new procedure
  411. PRTSCR sends the current screen to the printer. The new routines
  412. GETPRTFN and SETPRT get and set respectively the number of printer
  413. default retry times before a timeout.
  414.    TICKSFN is a simple complement to the TIMERFN already in the
  415. collection. TICKSFN gives the number of clock ticks (there are 18.2
  416. per second) since midnight.
  417.    A new LASTDMFN returns the number of days in a given month and
  418. year. DATEOKFN tells whether a date is a valid, existing date.
  419. ZELLERFN lets you compare which of the two dates is earlier,
  420. calculate the number of days between two dates etc.
  421.    A new FIXEDFN returns whether a drive is a fixed disk or not.
  422. MATHCOFN returns if a math coprocessor is present. RS232FN returns
  423. the number of serial ports. PARPORFN returns the number of parallel
  424. ports. COUNTRFN returns the country code. CHIPFN returns the type of
  425. the processor chip.
  426.    There are new keyboard routines. SCRLONFN gets the current
  427. ScrollLock status. CAPS, NUMLOCK, and SCRLOCK respectively set the
  428. CapsLock, NumLock and ScrollLock on, or off. They take the desired
  429. status as a boolean argument.
  430.   CLS sets 25*80 text mode and clears the screen and CLS40 does
  431. likewise for 25*40. Crt is not required.
  432.    So far none of the routines in the TSPAS collection have included
  433. any inline code. Starting from tspas20.arc this no longer holds. I
  434. have tried to understand some assembler and have included also
  435. inline code. Be warned that I cannot give any guarantees that the
  436. inline coded routines won't cause confusion.  Where inline code has
  437. been used, I have stated so. The first function to utilize this is
  438. LOWCASFN which is the exact opposite of Turbo Pascal's own UpCase
  439. function.
  440.    WARMBOOT simulating alt-clr-del, and COLDBOOT reboot with memory
  441. tests are new, inline routines.
  442.    A couple of routines have been moved from one unit to another.
  443.  
  444. Newsgroups: comp.lang.pascal
  445. From: ts@chyde.uwasa.fi (Timo Salmi)
  446. Subject: Redirecting writes to the printer
  447. Organization: University of Vaasa
  448. Date: Sun, 22 Jul 90 03:58:00 GMT
  449. (*
  450. About half a year ago several posters wanted to find a way to direct
  451. all output to the printer. (To enable a documentation of students'
  452. programming tasks.) For some reason nobody of us then found a simple
  453. working solution, which is outrageously elementary, after fact.
  454. There are, of course, alternative solutions, the most complicated
  455. being writing a new device driver. An intermediate (easier) solution
  456. is to juggle with certain TP predefined constants. I have two
  457. procedures USECON and USEPRN (in /pc/ts/tspas19.arc tpu collection)
  458. which when placed anywhere within the program will change the output
  459. device. But below is an example the the easiest alternative needing
  460. no accessories.
  461. *)
  462. program HowToRedirectAllOutputEasilyToThePrinter;
  463. {$DEFINE printit}
  464. begin
  465.   {$IFDEF printit}
  466.   assign (output, 'prn');
  467.   rewrite (output);
  468.   {$ENDIF}
  469.   :
  470.   writeln ('From Timo Salmi: Hello world, and whatever else');
  471.   :
  472.   {$IFDEF printit}
  473.   close (output);
  474.   {$ENDIF}
  475. end.  (* thus endeth the escapade *)
  476.  
  477. Thu 14-Jun-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  478. collection to be version (/pc/ts/)tspas19.arc. The function INDRIVFN
  479. in tsuntg.tpu tests whether a device is present in a drive. If you
  480. defined an invalid drive (such as '1'), a run time error occurred in
  481. my earlier versions. - Tsunta.tpu has a new function HIGHTFN, which
  482. gives the height of the screen by resolution (25, 43 or 50). -
  483. Tsuntf.tpu has a third enhanced readln with line editing, recall,
  484. insert toggle, and clean break potential. - Tsunth.tpu includes a
  485. new function ISDIRFNto test whether a name is a directory. -
  486. COPYFILE procedure copies a file from within a Turbo Pascal program
  487. and returns a success status code. I have seen postings in the
  488. (InterNet) news about problems with copying files in Turbo Pascal,
  489. but I hope that this one should do the trick. - OPENEDFN function
  490. indicates whether a text file has already been closed within the
  491. program, or if it is still open. This is particularly convenient for
  492. procedures aborting your program. - Tsuntd includes a new procedure
  493. called AUDIO. It is an enhanced version of Turbo Pascal's own sound
  494. procedure. It takes frequency and duration as parameters, and it
  495. does not need the presence of the interfering Crt unit. Audio was
  496. written in collaboration with Ari Hovila (ajh@chyde.uwasa.fi). - And
  497. since I am often asked the question, sorry, no, dear fellow users,
  498. the sources are not available, only the units and their documented
  499. interfaces.
  500.  
  501. Sun 25-Feb-90: I have gotten repeated requests from the users for a
  502. Turbo Pascal 5.5 version of my Turbo Pascal units collection. I now
  503. have finally got the 5.5 compiler, courtesy of University of Vaasa,
  504. because it was felt here that this international interaction is
  505. important enough to warrant the expense. (As I have told many of the
  506. users who have contacted me in this matter, I am not yet interested
  507. in OOP myself). Hence I am in a position to oblige. The new version
  508. is called tspas18.arc. There is only one new function in the
  509. collection this time. The main point was providing the TP 5.5
  510. versions of the units. Thus there are now three versions of each
  511. unit in this new release: TP 4.0, 5.5, and 5.5. - It is true that
  512. Borland has made excellent products for the PC community, but the
  513. incompatibility between the TPUs of the different Turbo Pascal
  514. versions has many of us users disgruntled.
  515.  
  516. Wed 6-Dec-89: Updated the Turbo Pascal 5.0 (and 4.0) units
  517. collection to be version /pc/ts/tspas17. The new procedures include
  518. WHEREXFN and WHEREYFN which locate the cursor position without the
  519. Crt unit. As you will recall Crt unit includes a WhereX and a WhereY
  520. function. The reason I have prepared alternatives to Crt functions
  521. and procedures in this, and the earlier releases, is because with
  522. some incompatible PCs the Crt unit causes problems, and redirection
  523. requires special measures with the Crt. - KEYPREFN is a replacement
  524. of KeyPressed and READKEFN for ReadKey. - CLUSIZFN gives the cluster
  525. size on a device. ALLSIZFN gives the true total size allocated to a
  526. file instead of the size shown on ordinary directory listings. -
  527. INKEYFN is a Basic-like timed input.
  528.  
  529. Tue 28-Nov-89: Some time ago there was a lively discussion in the
  530. InterNet news group comp.lang.pascal how to redirect all write and
  531. writeln statements to the printer without having to change the
  532. statements. I now have a solution to that problem for Turbo Pascal
  533. 4.0 and 5.0. The procedures USEPRN and USECON are part of update
  534. /pc/ts/tspas16.arc of my Turbo Pascal 5.0 and 4.0 units collection.
  535. The new procedures/functions also include WEEKNRFN function in the
  536. TSUNTE unit. It gives the weeknumber for a given date. REVCOLOR in
  537. TSUNTC reverses (toggles) text colors. And there are many other new
  538. routines making up a new unit TSUNTG.
  539.  
  540. Thu 26-Oct-89: I have a private mailing list for emailing these
  541. update news. Especially, if you have my programs downloadable at
  542. your site or your BBS you are welcome to ask for inclusion on this
  543. list.
  544.  
  545. Wed 18-Oct-89: Released update /pc/ts/tspas15.arc of my Turbo Pascal
  546. 5.0 and 4.0 units collection. New procedures/functions include BINFN
  547. in TSUNTB for fast conversion of decimal words to binary and HEXFN
  548. for fast conversion to hexadecimal. LBIN and LHEX convert long
  549. integers fast to binary and hexadecimal respectively. POWERLFN
  550. raises a longint to a power, fast. BORDER in TSUNTE changes the
  551. border color for CGA or VGA. All the rest of the procedures and
  552. functions remain unchanged.
  553.  
  554. Tue 26-Sep-89: Released update /pc/ts/tspas14.arc of the Turbo
  555. Pascal 5.0 and 4.0 units collection. The package contains units from
  556. tsunta.tpu to tsuntf.tpu. Tsunte.tpu contains a new function
  557. cmdlnfn, which gives the entire command line in a program call. The
  558. input line-editing procedure edreadln in tsuntf.tpu now has a recall
  559. option (CursorUp) and the insert key toggle. I have preserved an
  560. edrdln procedure for line-editing without recall and insert. Tsuntd
  561. has new ParamCount and ParamStr like functions for obtaining
  562. substrings from a string.
  563.  
  564. Sat 19-Aug-89: Released update /pc/ts/tspas13.arc of my Turbo Pascal
  565. units.  I have rewritten the cursor-size routines in a more general
  566. fashion and rearranged the units. 
  567.    One of the weaknesses of the readln statement in (Turbo) Pascal
  568. is that it does not allow editing the input-string while giving the
  569. input from the keyboard.  I decided to do something about this, and
  570. wrote an edreadln procedure, which allows to use of LeftCursor,
  571. RightCursor, BackSpace, Del, Home, End, and Esc.  Of course such
  572. routines are very common in input from popup windows.  Edreadln is,
  573. however, more of a readln-type procedure with normal scrolling
  574. capabilities, than a fixed position window routine.  This routine is
  575. included in the new release. 
  576.  
  577. Wed 2-Aug-89: I have released un updated version of the Turbo Pascal
  578. units collection tspas12.arc.  There are new string routines and
  579. detection of the monitor (mono/color) type.
  580.  
  581.  
  582. =======================================================================
  583.                   Messages from UseNet news
  584. =======================================================================
  585.  
  586. From ts Sat Jul 28 09:25:43 1990
  587. Subject: Re: Program selftesting and viruses
  588. To: 16012_3045@uwovax.uwo.ca (Paul Gomme)
  589. Date: Sat, 28 Jul 90 9:25:43 EET DST
  590. In-Reply-To: <0649102756@uwovax.uwo.ca>; from "Paul Gomme" at Jul 27, 90 6:19 pm
  591. X-Mailer: ELM [version 2.2 PL16]
  592. Status: OR
  593.  
  594. > >     Programmers: Help fighting viruses and patching.
  595. > >
  596. > >Viruses and unauthorized patching are problems which should be
  597. > >fought against by the PC community. This program demonstrates a
  598. > >simple and a reasonably general, fast selftest to detect whether the
  599. > >program has caught a virus, or if it has been amateurishly patched.
  600. > >The code is easily incorporated in any Turbo Pascal source code. The
  601. > >idea is to check whether the file date and size have been altered.
  602. > >Most .exe viruses work by appending their code to the .exe file
  603. > >altering the file size. Trivial patching changes the file date.
  604. > >Either of these is detected by selftest.
  605. > While the idea may have some merits, the execution is flawed.
  606.                                                         ^^^^^^
  607. No Paul, not flawed.  Rather not foolproof, nor is meant to be. 
  608.  
  609. > First, it is a minor matter to obtain the creation date of a file. 
  610. > Consequently, it is a relatively simple matter to apply a patch
  611. > which doesn't alter the file size, and restore the original creation
  612. > date.  Your technique is subject to such an "attack". 
  613.  
  614. Certainly.  The whole philosophy behind is to have a simple method
  615. which staves off any crude attempts.  The problem with the more
  616. elaborate selfchecks (such as embedded checksums) is that they are
  617. difficult to implement. 
  618.  
  619. > Second, there are often good reasons to patch a file.  Some of these
  620. > reasons are cosmetic in nature.  Some programs even encourage user
  621. > patching. 
  622.  
  623. Also true, and then such patching should take care of the date.  Or
  624. the selftest should have a relevant modification or omission of the
  625. date test. 
  626.  
  627. > From a more philosophical point of view, I wonder if protection
  628. > schemes don't in part encourage those who write viruses.  Surely
  629. > part of the "thrill" is to avoid detection. 
  630.  
  631. Maybe.  It can be looked at as a kind of a game.  Nevertheless,
  632. consider the popularity eg McAfee's virus control programs have
  633. gained.  Throwing one's hands up in the air is not a good solution. 
  634.  
  635. All the best, Timo
  636.  
  637. =======================================================================
  638.  
  639. From ts Tue Jul 31 12:07:13 1990
  640. Return-Path: <ts>
  641. Received: by uwasa.fi (4.1/(hh)29May89)
  642.     id AA08907; Tue, 31 Jul 90 12:07:12 +0300
  643. From: Timo Salmi LASK <ts>
  644. Message-Id: <9007310907.AA08907@uwasa.fi>
  645. Subject: selftest
  646. To: ts (Timo Salmi LASK)
  647. Date: Tue, 31 Jul 90 12:07:11 EET DST
  648. X-Mailer: ELM [version 2.2 PL16]
  649. Status: O
  650.  
  651. Newsgroups: comp.lang.pascal
  652. Path: uwasa.fi!ts
  653. From: ts@uwasa.fi (Timo Salmi LASK)
  654. Subject: Re: Program selftesting and viruses
  655. Message-ID: <1990Jul31.085732.8728@uwasa.fi>
  656. Organization: University of Vaasa
  657. References: <1990Jul27.182520.12051@uwasa.fi> <1875@krafla.rhi.hi.is>
  658. Date: Tue, 31 Jul 90 08:57:32 GMT
  659.  
  660. In article <1875@krafla.rhi.hi.is> frisk@rhi.hi.is (Fridrik Skulason) writes:
  661. >This program works in most cases - however, it is not effective against some
  662. >of the latest viruses, which fool it by making the program appear unchanged,
  663. >after the virus is in control.
  664.  
  665. This is certainly true, and the purpose of the code is to easily
  666. weed out elementary cases, which are the most frequent anyway.  One
  667. of the points was to make the code simple to understand and include. 
  668. The other alternative is to imbed a checksum in the .exe file.  But
  669. the code is much more complicated, because the checksum (either
  670. direct or crc) constant itself within the program must be skipped
  671. when recalculating the checksum.  Another problem is that the
  672. checksum must be calculated fast.  Else it renders the host program
  673. useless.  I have the code also for calculating and checking the
  674. direct checksum of an .exe file in addition to size & date check. 
  675. This should be fairly effective.  This will be included in the
  676. upcoming update of my Turbo Pascal units tspas21.arc. 
  677.